# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.APIGateway.V1beta.Model.ApigatewayApi do
  @moduledoc """
  An API that can be served by one or more Gateways.

  ## Attributes

  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Created time.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - Optional. Display name.
  *   `labels` (*type:* `map()`, *default:* `nil`) - Optional. Resource labels to represent user-provided metadata. Refer to cloud documentation on labels for more details. https://cloud.google.com/compute/docs/labeling-resources
  *   `managedService` (*type:* `String.t`, *default:* `nil`) - Optional. Immutable. The name of a Google Managed Service ( https://cloud.google.com/service-infrastructure/docs/glossary#managed). If not specified, a new Service will automatically be created in the same project as this API.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. Resource name of the API. Format: projects/{project}/locations/global/apis/{api}
  *   `state` (*type:* `String.t`, *default:* `nil`) - Output only. State of the API.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Updated time.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :createTime => DateTime.t() | nil,
          :displayName => String.t() | nil,
          :labels => map() | nil,
          :managedService => String.t() | nil,
          :name => String.t() | nil,
          :state => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:createTime, as: DateTime)
  field(:displayName)
  field(:labels, type: :map)
  field(:managedService)
  field(:name)
  field(:state)
  field(:updateTime, as: DateTime)
end

defimpl Poison.Decoder, for: GoogleApi.APIGateway.V1beta.Model.ApigatewayApi do
  def decode(value, options) do
    GoogleApi.APIGateway.V1beta.Model.ApigatewayApi.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.APIGateway.V1beta.Model.ApigatewayApi do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
